<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>BBS后台登陆</title>
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<script type="text/javascript" src="js/js.js"></script>
 <script type="text/javascript" src="js/jquery-1.7.2.js"></script>
  <script type="text/javascript">
  var req;
  
  //提交留言
  function pubMsg(){
  		 var loginuserinfo=document.getElementById("user");
			if(trim(loginuserinfo.value)==""){
				alert("账号不能为空");
				return  ;
			}
			var password=document.getElementById("pwd");
			if(trim(password.value)==""){
				alert("密码不能为空");
				return ;
			}	
	  	  $.ajax({
				type: "POST",
				url: "PubMsg_checkPubMsg.do",
				dateType: "html",
				data: {'verifyCode': $("#verifyCode").val()},
				success: function(returnedData){
					if(returnedData=="this"){
						alert("验证码不正确，请重新输入");
						changeVerifyCode();
					}else{
							 $.ajax({
								type: "POST",
								url: "bbsUserInfo_checkLogin.do",
								dateType: "html",
								data: {'bbsUserInfo.email': $("#loginuser_email1").val(),
										'bbsUserInfo.password': $("#loginuser_password1").val()},
								success: function(returnedData){
									if(returnedData=="this"){
										alert("用户名或密码不正确，请重新输入");
									}else{
										$("#login").submit();
									}
									
								}
							});
					}
					
				}
			});
  }
  //更换验证码
  function changeVerifyCode(){
  	t=new Date();
  	document.getElementById("verifyCodeImg").src="verifyCode.do?t="+t;
  }
   
  </script>
</head>
<body>
<div id="top"> </div>
<form id="login" name="login" action="bbsUserInfo_loginManager.do" method="post">
  <div id="center">
    <div id="center_left"></div>
    <div id="center_middle">
      <div class="user">
        <label>用户名
        <input type="text" name="bbsUserInfo.email" id="user" />
        </label>
      </div>
      <div class="user">
        <label>密码
        <input type="password" name="bbsUserInfo.password" id="pwd" />
        </label>
      </div>
      <div class="chknumber">
        <label>验证码
        <input name="chknumber" type="text" id="chknumber" maxlength="4" class="chknumber_input" />
        <img name="verifyCodeImg"  id= "verifyCodeImg" src="" style="cursor:hand" align="top" onClick="changeVerifyCode()"/>
         <font style="color:blue;font-size=14"><a href="javascript:changeVerifyCode()">看不清？</a></font>
        </label>
         
      </div>
    </div>
    <div id="center_middle_right"></div>
    <div id="center_submit">
      <div class="button"> <img src="images/dl.gif" width="57" height="20" onclick="form_submit()" > </div>
      <div class="button"> <img src="images/cz.gif" width="57" height="20" onclick="form_reset()"> </div>
    </div>
    <div id="center_right"></div>
  </div>
</form>
<div id="footer"></div>
</body>
</html>
